﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;

namespace mojoPortal.Web.RS.Bliss.Controls
{
    public partial class HeaderLinks : com.Bliss.UI.Common.UserControlBase
    {
        public string CompanyURL
        {
            get
            {
                return hdnCompanyURL.Value.Trim();
            }
            set
            {
                hdnCompanyURL.Value = value;
            }
        }
        public string GroupURL
        {
            get
            {
                return hdnGroupURL.Value.Trim();
            }
            set
            {
                hdnGroupURL.Value = value;
            }
        }
        public string PrivateURL
        {
            get
            {
                return hdnPrivateURL.Value.Trim();
            }
            set
            {
                hdnPrivateURL.Value = value;
            }
        }
        public string OP_SSOToken
        {
            get
            {
                return Convert.ToString(ViewState["OP_SSOToken"]);
            }
            set
            {
                ViewState["OP_SSOToken"] = value;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                companyLink.HRef = ResolveUrl(CompanyURL);
                groupLink.HRef = ResolveUrl(GroupURL);
                privateLink.HRef = ResolveUrl(PrivateURL);

                string url = Convert.ToString(ConfigurationSettings.AppSettings["CommPortal"]) + "?SsoToken=" + OP_SSOToken;
                commPortal.HRef = url;
            }
        }
    }
}